/**
  * @file		Meter.h
  * @author		Kruibkib
  * @version	V1.0.0
  * @date		October 19, 2013
  * @brief		Airbeam
  */
#ifndef __METER_H
#define __METER_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "helper.h"
#include "crc.h"
#include <stm32f4xx.h>
#include <stm32f4xx_dma.h>
#include <stm32f4xx_exti.h>
#include <stm32f4xx_gpio.h>
#include <stm32f4xx_rcc.h>
#include <stm32f4xx_syscfg.h>
#include <stm32f4xx_usart.h>
#include "MeterRS485.h"

/* Public typedef ------------------------------------------------------------*/
/* Public define -------------------------------------------------------------*/
	#define SOH 0x81
	#define STX 0x02
	#define ETX 0x03 
/* Public macro --------------------------------------------------------------*/
/* Public variables ----------------------------------------------------------*/
/* Public function prototypes ------------------------------------------------*/
void Meter_Connect(uint8_t address);
uint8_t add_parity(uint8_t ch);
uint8_t rm_parity(uint8_t val);
uint8_t bcc_parity(uint8_t mea[], int start,int end);
uint8_t crc_HI(uint16_t packet);
uint8_t crc_LO(uint16_t packet);
void Meter_Energy(uint8_t address);




#ifdef __cplusplus
}
#endif

#endif /* __METER_H */
